package com.wealth.lottery.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import redis.clients.jedis.Jedis;

public class Test {
	public static void main(String[] args) {
		final String watchkeys = "watchkeys";
		ExecutorService executor = Executors.newFixedThreadPool(5);//线程数

		final Jedis jedis = new Jedis("192.168.1.16", 6379);
		jedis.set(watchkeys, "0");// 重置watchkeys为0
		jedis.del("setsucc", "setfail");// 清空抢成功的，与没有成功的
		jedis.close();

		for (int i = 0; i < 100; i++) {// 测试一万人同时访问
			executor.execute(new MyRunnable());
			
		}
		executor.shutdown();
	}
}